package cn.ecsd.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * SysEmployee entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_employee", catalog = "jboa")

public class SysEmployee implements java.io.Serializable {

	// Fields

	private String sn;
	private SysPosition sysPosition;
	private SysDepartment sysDepartment;
	private String name;
	private String password;
	private String status;
	private Set<BizLeave> bizLeavesForEmployeeSn = new HashSet<BizLeave>(0);
	private Set<BizClaimVoucher> bizClaimVouchersForCreateSn = new HashSet<BizClaimVoucher>(0);
	private Set<BizClaimVoucher> bizClaimVouchersForNextDealSn = new HashSet<BizClaimVoucher>(0);
	private Set<BizLeave> bizLeavesForNextDealSn = new HashSet<BizLeave>(0);

	// Constructors

	/** default constructor */
	public SysEmployee() {
	}

	/** minimal constructor */
	public SysEmployee(String sn, SysPosition sysPosition, SysDepartment sysDepartment, String name, String password,
			String status) {
		this.sn = sn;
		this.sysPosition = sysPosition;
		this.sysDepartment = sysDepartment;
		this.name = name;
		this.password = password;
		this.status = status;
	}

	/** full constructor */
	public SysEmployee(String sn, SysPosition sysPosition, SysDepartment sysDepartment, String name, String password,
			String status, Set<BizLeave> bizLeavesForEmployeeSn, Set<BizClaimVoucher> bizClaimVouchersForCreateSn,
			Set<BizClaimVoucher> bizClaimVouchersForNextDealSn, Set<BizLeave> bizLeavesForNextDealSn) {
		this.sn = sn;
		this.sysPosition = sysPosition;
		this.sysDepartment = sysDepartment;
		this.name = name;
		this.password = password;
		this.status = status;
		this.bizLeavesForEmployeeSn = bizLeavesForEmployeeSn;
		this.bizClaimVouchersForCreateSn = bizClaimVouchersForCreateSn;
		this.bizClaimVouchersForNextDealSn = bizClaimVouchersForNextDealSn;
		this.bizLeavesForNextDealSn = bizLeavesForNextDealSn;
	}

	// Property accessors
	@Id

	@Column(name = "SN", unique = true, nullable = false, length = 50)

	public String getSn() {
		return this.sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "POSITION_ID", nullable = false)

	public SysPosition getSysPosition() {
		return this.sysPosition;
	}

	public void setSysPosition(SysPosition sysPosition) {
		this.sysPosition = sysPosition;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "DEPARTMENT_ID", nullable = false)

	public SysDepartment getSysDepartment() {
		return this.sysDepartment;
	}

	public void setSysDepartment(SysDepartment sysDepartment) {
		this.sysDepartment = sysDepartment;
	}

	@Column(name = "NAME", nullable = false, length = 50)

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "PASSWORD", nullable = false, length = 50)

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "STATUS", nullable = false, length = 20)

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "sysEmployeeByEmployeeSn")

	public Set<BizLeave> getBizLeavesForEmployeeSn() {
		return this.bizLeavesForEmployeeSn;
	}

	public void setBizLeavesForEmployeeSn(Set<BizLeave> bizLeavesForEmployeeSn) {
		this.bizLeavesForEmployeeSn = bizLeavesForEmployeeSn;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "sysEmployeeByCreateSn")

	public Set<BizClaimVoucher> getBizClaimVouchersForCreateSn() {
		return this.bizClaimVouchersForCreateSn;
	}

	public void setBizClaimVouchersForCreateSn(Set<BizClaimVoucher> bizClaimVouchersForCreateSn) {
		this.bizClaimVouchersForCreateSn = bizClaimVouchersForCreateSn;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "sysEmployeeByNextDealSn")

	public Set<BizClaimVoucher> getBizClaimVouchersForNextDealSn() {
		return this.bizClaimVouchersForNextDealSn;
	}

	public void setBizClaimVouchersForNextDealSn(Set<BizClaimVoucher> bizClaimVouchersForNextDealSn) {
		this.bizClaimVouchersForNextDealSn = bizClaimVouchersForNextDealSn;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "sysEmployeeByNextDealSn")

	public Set<BizLeave> getBizLeavesForNextDealSn() {
		return this.bizLeavesForNextDealSn;
	}

	public void setBizLeavesForNextDealSn(Set<BizLeave> bizLeavesForNextDealSn) {
		this.bizLeavesForNextDealSn = bizLeavesForNextDealSn;
	}

}